azure deployment option source not showing vsts - azure

If I select Deployment Option, VSTS as a source is not available. The option was available for the other app service I created using this account. But I come back from lunch and now I can't select VSTS as a source for deployment option. I've tried deleting and re-creating the app service. Logging in on another browser and nothing. If I select the Deployment Center (Preview) option, it DOES see my VSTS repos. So what gives?

Related

configBuilder 'Secrets' failed

After the initial attempt to publish my web app to Azure I got the following error. I'm using Visual Studio 2019.
Is there a way to undo the publish?
How do I determine what is missing?
The configBuilder 'Secrets' failed while processing the configuration section 'appSettings'.: 'Secrets' Initialization Error: Method not found: 'System.String Microsoft.Configuration.ConfigurationBuilders.Utils.MapPath(System.String)'.
How do I undo the changes that Publish did within my project:
Approach-1:-
Generally, Azure Web Apps provides back up feature which you may enable in your app to keep a backup of your site. If you are sure that the deployment did not go as planned, you can restore the backup.
Goto App Service -> Choose BackUps
You can see the status of the webapps for every hour as shown here:
Click on Restore icon if needed.
Enter the restore location in Choose a location. Select Create new under the App Service box to restore to a new app. Select Create new beneath the Deployment slot box to restore to a new deployment slot.
You can choose the site configuration as well as per requirements. After providing all these, restore it.
Approach-2:-
Usually after publishing any web app to azure from local, it will be deployed on production server.
You may want to undertake some activity or verification before delivering/after delivering the website to production. You can use deployment slots in this case.
Azure provides non-production deployment slots for each web app, on which we can deploy the website temporarily.
Detailed in article given by #Krishna Kumar.
Create deployment slot by adding a slot under app service as shown:
Alternative Reference: Get publish profile

Azure App service Deploy fails with Error: 'credentials' cannot be null

I have a portal account, and a devlops account. Both happen to use the same login/password.
In the portal.azure.com, I have a working web service.
Under the web services "deployment-Deployment center" I select azure repos, azure pipelines as the build provider, set master branch etc.
It created a pipeline in my devlops which worked, i.e. it did NuGet restore, build solution, test assemblies, publish symbols path, publish artifact.
Great.
But it did not deploy the new build.
Clicking on "releases" in pipleines in devops, it was trying to use "Azure web app deploy" and giving an error that msbuild doesnt use the right format or similar. So I changed it to "Azure App Service Deploy".
Now I get a new error: Error: 'credentials' cannot be null.
There is no field for credentials.
It is using a publish profile.
Any ideas how I fix this?
here is the offending task:
There is no option to configure the missing credentials?
If I go to portal, and look at the "Deployment center", I see this:
If I click on "deployment credentials" I see this:
Which all looks good.
Any idea where the "null" credentials comes from?
Have you tried adding a new service connection in Project Settings and selecting Service Connections there? Even updating the Service connection created by Azure Portal threw an error for me.
In my case the issue was I did not have proper access rights to allow the connection between my pipeline and the Azure App. I was listed as a Contributor on the subscription. I contacted our company Devops and she updated the service connection without any issues because she was listed as an Owner or User Access Administrator.
Use "Azure Web App" task instead. Create a service connection using the publish profile route then use it within the task. Make sure you tick off "Deploy to Slot or App Service Environment" and it should work.
Have a read on this. They updated the services. You need to follow the Action Required.

How to include appsettings.json settings into Azure DevOps build and release pipeline

We are currently researching the usage of Azure DevOps Build and Release pipelines.
We did successfully create a simple Asp.NET Core web application and pushed that application into an Azure DevOps repository.
We did successfully create a pipeline for that application consisting of Restore, Build, Test, Publish, and Publish Artifacts (as shown on the attached image) and successfully built that pipeline.
In the Azure Portal, we did successfully create a Resource Group and the Web App to host the web application
In the Azure DevOps, we did successfully create a release for that application and did successfully publish the application to the created Web App
However, in the Azure Portal, in the newly created Web App configuration section, there are no config values transferred from the application's appsettings.json.
I did try to use 'Link settings' feature on the Publish segment of the pipeline, but that didn't work
Thus, the question is how do I transfer the config values of the ASP.NET Core Web application into an Azure Portal Web App through an Azure DevOps pipeline and release?
We found a solution
Click plus sign on the pipeline (add new task) and choose 'Azure App Service Settings'
On the App Settings for the Task, add the settings you need
Save, build and add to the release
Settings from appsettings.json are not displayed in Azure App Service Configuration, but settings defined there override values in appsettings.json. So if you define again key/pair in Configuration tab it will override value from file.
Here is a link for documentation.

No Deployment Option under Deployment found in Azure Web App Service

Unable to configure Azure Web App Service to work with Github since the Deployment Option is disappeared
I am current following "Visualize real-time sensor data from your Azure IoT hub by using the Web Apps feature of Azure App Service" (https://learn.microsoft.com/en-us/azure/iot-hub/iot-hub-live-data-visualization-in-web-apps) to visualize IoT Hub Data. When I get to 'Upload a web application to be hosted by the web app', it instructs me to configure to work with Github. By going into the web app, click Deployment Options > Choose Source > Local Git Repository, and then click OK. However, I can not find the Deployment Option under Deployment. Any idea if there is some option that needs to turn on.
See the screenshot https://drive.google.com/file/d/1K5JQrTz60D_jaCdZihZKI3N67z9kV-i6/view?usp=sharing
The portal has changed, you can find the Local Git Repository under Deployment Center.

Can I tell in the portal when an Azure deployment happened?

When we deploy our App Service from Visual Studio 2015 to Azure we tag the current commit in Git so that we can get back to any of our past deployments.
But I suspect that we forgot to do that when we deployed our current ASP API.
Using the Azure portal how do I tell when the deployment running in one of our app service's deployment slots was made?
Maybe try using kudu: https://[webappname].scm.azurewebsites.net/ - you can see file timestamps in the console.
If you are use classic portal, you can find the deployment history list in the DEPLOYMENTS tab of your app service application. And you can click one of them, click the REDEPLOY button at the bottom nav bar to rollback to the specific deployment version.
If you are using Azure portal, you also can find the deployment history, by clicking deployment source => selecting the specific deployment version=>click redeploy button to rollback.
By clicking you service you can go to All Settings --> Audit Logs. There you can filter by 'Update website'

Resources