Deploy Code from GitLab Repository to Azure Web App using PowerShell









up vote
4
down vote

favorite
3












I would like to setup continuous deployment from a GitLab repository to an Azure App using a PowerShell script. I'm aware that you can do this manually as per:



https://christianliebel.com/2016/05/auto-deploying-to-azure-app-services-from-gitlab/



However, I'm trying to automate this with Powershell. I've looked at this sample script for GitHub:



https://docs.microsoft.com/en-us/azure/app-service/scripts/app-service-powershell-continuous-deployment-github



But as there is no provider for GitLab, and none of the existing providers accept a GitLab URL, I'm unsure of how to proceed. I've looked at setting up a manual deployment with GitLab in the Azure Portal (using the External Repository option) and exporting the resource group template to get details of how the repository is connected to the App, but I get the error:



Could not get resources of the type 'Microsoft.Web/sites/sourcecontrols'. Resources of this type will not be exported. (Code: ExportTemplateProviderError, Target: Microsoft.Web/sites/sourcecontrols)



At the minute, I'm working around this by mirroring my GitLab repository in GitHub, and using the continuous deployment pipeline from there to Azure. Can I set this up pipeline directly from GitLab to Azure using Powershell?



Update 08/11/2018



Just to confirm, I wish to use a PowerShell script to setup a Continuous Deployment from GitLab to Azure. Once the script is run, each subsequent commit/merge to the GitLab repository should then automatically be deployed to Azure. Thanks.










share|improve this question

















This question has an open bounty worth +250
reputation from MagicAndi ending ending at 2018-11-15 09:48:55Z">in 4 days.


Looking for an answer drawing from credible and/or official sources.


For this bounty, I would expect an answer that includes fully documented and tested PowerShell code that be proven to work in the specific case outlined in my question. If you need any further information, please leave a comment on the question - I'll check daily and update as required.















  • Hi, great question, when you say looking for a PowerShell option that sounds like a manual trigger of some sort. Are you after a complete continuous deployment e.g. a deploy on each commit / merge to master etc. Or is it sufficient to have a manual trigger?
    – Alex KeySmith
    2 days ago














up vote
4
down vote

favorite
3












I would like to setup continuous deployment from a GitLab repository to an Azure App using a PowerShell script. I'm aware that you can do this manually as per:



https://christianliebel.com/2016/05/auto-deploying-to-azure-app-services-from-gitlab/



However, I'm trying to automate this with Powershell. I've looked at this sample script for GitHub:



https://docs.microsoft.com/en-us/azure/app-service/scripts/app-service-powershell-continuous-deployment-github



But as there is no provider for GitLab, and none of the existing providers accept a GitLab URL, I'm unsure of how to proceed. I've looked at setting up a manual deployment with GitLab in the Azure Portal (using the External Repository option) and exporting the resource group template to get details of how the repository is connected to the App, but I get the error:



Could not get resources of the type 'Microsoft.Web/sites/sourcecontrols'. Resources of this type will not be exported. (Code: ExportTemplateProviderError, Target: Microsoft.Web/sites/sourcecontrols)



At the minute, I'm working around this by mirroring my GitLab repository in GitHub, and using the continuous deployment pipeline from there to Azure. Can I set this up pipeline directly from GitLab to Azure using Powershell?



Update 08/11/2018



Just to confirm, I wish to use a PowerShell script to setup a Continuous Deployment from GitLab to Azure. Once the script is run, each subsequent commit/merge to the GitLab repository should then automatically be deployed to Azure. Thanks.










share|improve this question

















This question has an open bounty worth +250
reputation from MagicAndi ending ending at 2018-11-15 09:48:55Z">in 4 days.


Looking for an answer drawing from credible and/or official sources.


For this bounty, I would expect an answer that includes fully documented and tested PowerShell code that be proven to work in the specific case outlined in my question. If you need any further information, please leave a comment on the question - I'll check daily and update as required.















  • Hi, great question, when you say looking for a PowerShell option that sounds like a manual trigger of some sort. Are you after a complete continuous deployment e.g. a deploy on each commit / merge to master etc. Or is it sufficient to have a manual trigger?
    – Alex KeySmith
    2 days ago












up vote
4
down vote

favorite
3









up vote
4
down vote

favorite
3






3





I would like to setup continuous deployment from a GitLab repository to an Azure App using a PowerShell script. I'm aware that you can do this manually as per:



https://christianliebel.com/2016/05/auto-deploying-to-azure-app-services-from-gitlab/



However, I'm trying to automate this with Powershell. I've looked at this sample script for GitHub:



https://docs.microsoft.com/en-us/azure/app-service/scripts/app-service-powershell-continuous-deployment-github



But as there is no provider for GitLab, and none of the existing providers accept a GitLab URL, I'm unsure of how to proceed. I've looked at setting up a manual deployment with GitLab in the Azure Portal (using the External Repository option) and exporting the resource group template to get details of how the repository is connected to the App, but I get the error:



Could not get resources of the type 'Microsoft.Web/sites/sourcecontrols'. Resources of this type will not be exported. (Code: ExportTemplateProviderError, Target: Microsoft.Web/sites/sourcecontrols)



At the minute, I'm working around this by mirroring my GitLab repository in GitHub, and using the continuous deployment pipeline from there to Azure. Can I set this up pipeline directly from GitLab to Azure using Powershell?



Update 08/11/2018



Just to confirm, I wish to use a PowerShell script to setup a Continuous Deployment from GitLab to Azure. Once the script is run, each subsequent commit/merge to the GitLab repository should then automatically be deployed to Azure. Thanks.










share|improve this question















I would like to setup continuous deployment from a GitLab repository to an Azure App using a PowerShell script. I'm aware that you can do this manually as per:



https://christianliebel.com/2016/05/auto-deploying-to-azure-app-services-from-gitlab/



However, I'm trying to automate this with Powershell. I've looked at this sample script for GitHub:



https://docs.microsoft.com/en-us/azure/app-service/scripts/app-service-powershell-continuous-deployment-github



But as there is no provider for GitLab, and none of the existing providers accept a GitLab URL, I'm unsure of how to proceed. I've looked at setting up a manual deployment with GitLab in the Azure Portal (using the External Repository option) and exporting the resource group template to get details of how the repository is connected to the App, but I get the error:



Could not get resources of the type 'Microsoft.Web/sites/sourcecontrols'. Resources of this type will not be exported. (Code: ExportTemplateProviderError, Target: Microsoft.Web/sites/sourcecontrols)



At the minute, I'm working around this by mirroring my GitLab repository in GitHub, and using the continuous deployment pipeline from there to Azure. Can I set this up pipeline directly from GitLab to Azure using Powershell?



Update 08/11/2018



Just to confirm, I wish to use a PowerShell script to setup a Continuous Deployment from GitLab to Azure. Once the script is run, each subsequent commit/merge to the GitLab repository should then automatically be deployed to Azure. Thanks.







azure powershell gitlab






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited yesterday

























asked Oct 5 at 11:13









MagicAndi

20.7k2272102




20.7k2272102






This question has an open bounty worth +250
reputation from MagicAndi ending ending at 2018-11-15 09:48:55Z">in 4 days.


Looking for an answer drawing from credible and/or official sources.


For this bounty, I would expect an answer that includes fully documented and tested PowerShell code that be proven to work in the specific case outlined in my question. If you need any further information, please leave a comment on the question - I'll check daily and update as required.








This question has an open bounty worth +250
reputation from MagicAndi ending ending at 2018-11-15 09:48:55Z">in 4 days.


Looking for an answer drawing from credible and/or official sources.


For this bounty, I would expect an answer that includes fully documented and tested PowerShell code that be proven to work in the specific case outlined in my question. If you need any further information, please leave a comment on the question - I'll check daily and update as required.













  • Hi, great question, when you say looking for a PowerShell option that sounds like a manual trigger of some sort. Are you after a complete continuous deployment e.g. a deploy on each commit / merge to master etc. Or is it sufficient to have a manual trigger?
    – Alex KeySmith
    2 days ago
















  • Hi, great question, when you say looking for a PowerShell option that sounds like a manual trigger of some sort. Are you after a complete continuous deployment e.g. a deploy on each commit / merge to master etc. Or is it sufficient to have a manual trigger?
    – Alex KeySmith
    2 days ago















Hi, great question, when you say looking for a PowerShell option that sounds like a manual trigger of some sort. Are you after a complete continuous deployment e.g. a deploy on each commit / merge to master etc. Or is it sufficient to have a manual trigger?
– Alex KeySmith
2 days ago




Hi, great question, when you say looking for a PowerShell option that sounds like a manual trigger of some sort. Are you after a complete continuous deployment e.g. a deploy on each commit / merge to master etc. Or is it sufficient to have a manual trigger?
– Alex KeySmith
2 days ago












1 Answer
1






active

oldest

votes

















up vote
0
down vote













It sounds like you are looking for a direct deploy from GitLab to Azure Apps, however I'd suggest using a deployment pipeline tool to give you far more options.



Azure DevOps Services Pipelines would likely be a safe option and has a free tier and here's a very brief getting started guide for Web Apps deploys.



However it doesn't have built in support for GitLab, but there appears to be a marketplace tool for integrations with GitLab.



This doesn't appear to have the capability of release triggers, but could be triggered manually. Someone else has the question about release triggers in the marketplace Q&A so perhaps it will be in the roadmap.






share|improve this answer




















    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f52664359%2fdeploy-code-from-gitlab-repository-to-azure-web-app-using-powershell%23new-answer', 'question_page');

    );

    Post as a guest






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













    It sounds like you are looking for a direct deploy from GitLab to Azure Apps, however I'd suggest using a deployment pipeline tool to give you far more options.



    Azure DevOps Services Pipelines would likely be a safe option and has a free tier and here's a very brief getting started guide for Web Apps deploys.



    However it doesn't have built in support for GitLab, but there appears to be a marketplace tool for integrations with GitLab.



    This doesn't appear to have the capability of release triggers, but could be triggered manually. Someone else has the question about release triggers in the marketplace Q&A so perhaps it will be in the roadmap.






    share|improve this answer
























      up vote
      0
      down vote













      It sounds like you are looking for a direct deploy from GitLab to Azure Apps, however I'd suggest using a deployment pipeline tool to give you far more options.



      Azure DevOps Services Pipelines would likely be a safe option and has a free tier and here's a very brief getting started guide for Web Apps deploys.



      However it doesn't have built in support for GitLab, but there appears to be a marketplace tool for integrations with GitLab.



      This doesn't appear to have the capability of release triggers, but could be triggered manually. Someone else has the question about release triggers in the marketplace Q&A so perhaps it will be in the roadmap.






      share|improve this answer






















        up vote
        0
        down vote










        up vote
        0
        down vote









        It sounds like you are looking for a direct deploy from GitLab to Azure Apps, however I'd suggest using a deployment pipeline tool to give you far more options.



        Azure DevOps Services Pipelines would likely be a safe option and has a free tier and here's a very brief getting started guide for Web Apps deploys.



        However it doesn't have built in support for GitLab, but there appears to be a marketplace tool for integrations with GitLab.



        This doesn't appear to have the capability of release triggers, but could be triggered manually. Someone else has the question about release triggers in the marketplace Q&A so perhaps it will be in the roadmap.






        share|improve this answer












        It sounds like you are looking for a direct deploy from GitLab to Azure Apps, however I'd suggest using a deployment pipeline tool to give you far more options.



        Azure DevOps Services Pipelines would likely be a safe option and has a free tier and here's a very brief getting started guide for Web Apps deploys.



        However it doesn't have built in support for GitLab, but there appears to be a marketplace tool for integrations with GitLab.



        This doesn't appear to have the capability of release triggers, but could be triggered manually. Someone else has the question about release triggers in the marketplace Q&A so perhaps it will be in the roadmap.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 2 days ago









        Alex KeySmith

        9,618447104




        9,618447104



























             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f52664359%2fdeploy-code-from-gitlab-repository-to-azure-web-app-using-powershell%23new-answer', 'question_page');

            );

            Post as a guest














































































            Popular posts from this blog

            𛂒𛀶,𛀽𛀑𛂀𛃧𛂓𛀙𛃆𛃑𛃷𛂟𛁡𛀢𛀟𛁤𛂽𛁕𛁪𛂟𛂯,𛁞𛂧𛀴𛁄𛁠𛁼𛂿𛀤 𛂘,𛁺𛂾𛃭𛃭𛃵𛀺,𛂣𛃍𛂖𛃶 𛀸𛃀𛂖𛁶𛁏𛁚 𛂢𛂞 𛁰𛂆𛀔,𛁸𛀽𛁓𛃋𛂇𛃧𛀧𛃣𛂐𛃇,𛂂𛃻𛃲𛁬𛃞𛀧𛃃𛀅 𛂭𛁠𛁡𛃇𛀷𛃓𛁥,𛁙𛁘𛁞𛃸𛁸𛃣𛁜,𛂛,𛃿,𛁯𛂘𛂌𛃛𛁱𛃌𛂈𛂇 𛁊𛃲,𛀕𛃴𛀜 𛀶𛂆𛀶𛃟𛂉𛀣,𛂐𛁞𛁾 𛁷𛂑𛁳𛂯𛀬𛃅,𛃶𛁼

            Edmonton

            Crossroads (UK TV series)