From Visual Studio, unable to publish to Azure App Service - azure

Using this Official Azure tutorial. I have work Azure account that I can successfully login. The account allows $150 per month of which I have $93 left.
But, as instructed in Publish to Azure App Service section of the tutorial, when I select Azure App Service as the Publish Target on the wizard, it takes me to following screen where I sign in as my work Azure account. But it does nothing after I login, and the Next button stayed grey. When I click on can't access account button and fill in requested info, I get the next screen (also shown in the image below). I, then first successfully logged in to my Azure account from outside of VS2017 and then tried the above process again but still the same issue:
UPDATE
Moreover, I just deployed the same app using this Official Azure tutorial that is not using Visual Studio. But I want to able to deploy it using VS2017 as I create projects using VS2017 only.

I think your problem is the identity (MS acct) which you are logged into VS2017 with. You want to be sure that you are logged in to VS with the account which has rights to the subscription where you are trying to publish. Assuming that's your org account:
Click on your profile in the upper right corner and choose Account Settings. The window that pops up has a link to Add an account. You'll want to add your org account here. Now VS has the proper creds to publish to your subscription.
To verify that the creds are working, use the menu item View -> Cloud Explorer. You should see the other assets you've created in the target subscription.

Related

Creating an Azure Function in existing Function App on existing Subscription and Resource Group

I've developed a time triggered function in Microsoft Azure Functions with my personal subscription. The process made me create everything I needed from scratch in Visual Studio Code.
Now I would like to deploy the same function on a different subscription in which someone else have created a resource group, a function app and a storage account.
I'm not able to add these existing resources. Looks like from inside Visual Sudio Code I can only create a new resource group, storage account and function app in the same subscription as before even though I've signed out with my personal account and logged into the customer provided account.
Am I missing something obvious? Can someone point me in the right direction?
In Visual Studio Code you can select the Azure Subscription to which deploy your functions by opening the Azure tab on the left side menu (or Alt + Shift + A shortcut) and by clicking the "Select subscription" button under the "Functions" tab of that menu (see screenshot below).
screenshot
If your account has multiple subscriptions, then click this icon to select the other subscription where you need to deploy your function app or any other app as you can see in the below image:
even though I've signed out with my personal account and logged into the customer-provided account.
If the customer's subscription is available in your account, though you logged out from the account, it may have shown your subscriptions at the azure extension.
Press Ctrl + Shift + P in your VS Code, which opens the command palette.
Click on Azure: Sign Out for complete sign out in VS Code.
If you signed in again to the VS Code through Command Palette or Account extension on the sidebar, sync will not happen automatically. So, Click on Sign in to Sync settings which logs you to your Microsoft account to verify again.
Make sure this setting is turned on whichever the account (Customer's or Your Subscription) you logged in to VS Code.
This setting helps you to deploy your applications with any subscription in your account through the VS Code Editor.
Although other responses were useful to me and might prove useful to others, my specific problem was caused by the "Azure: Tenant" setting in the Visual Studio Code Settings.
This setting basically sets a specific subscription to use (identified by its ID). Once removed, with this field empty, the default behavior of the extension is to ask each time where to deploy a function.
As soon as I removed the value for this setting the second subscription appeared in Azure extension panel.

Azure web deployment

I get the below error when I try to publish my website from VS2017 to Azure. P.S : I already have an Azure account and url created for my website. Error description:
Web deployment task failed. (Connected to the remote computer
("rdproduct1.scm.azurewebsites.net") using the Web Management Service,
but could not authorize. Make sure that you are using the correct user
name and password, that the site you are connecting to exists, and
that the credentials represent a user who has permissions to access
the site. Learn more at:
http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_USER_UNAUTHORIZED.)
There are 2 areas that have to be setup to allow this to happen.
1). Azure portal - Locate the AppSvc Resource you're trying to deploy to. Under the action selection blade, select deployment credentials. Enter a username & pw. It has to be unique and doesn't need to tie to your email or login 2) Within Visual Studio. Right click on the project to deploy and select publish. When the publish page shows up, in the 'Summary' section to the right of the site URL you will see a hyperlink for "Settings" select it. In the page that comes up now, enter your user name and pw in the areas identified. Select Save. Once back on the previous page now hit the "Publish" button. Assuming your build is successful the app should publish with your "authentication" to the app service in Azure.

How To Tell What Subscription a Visual Studio Azure Wep App Will Be Published To

Given a VS web app project that has an existing Azure publish profile is there a way to tell what subscription the selected publish profile will publish the app to? We have such so many subscriptions it's quite time consuming to to use the portals poor blade interface to locate which subscription the app is in. Even opening the SCM site it seems apps know nothing about it's subscription.
As I know, we don't need Azure subscription information to publish our project. What we need is contentPath, ComputerName, UserName& Password when you use msdeploy. The following is the parameters that used to deploy:
.\msdeploy.exe -verb:sync -source:contentPath='E:\code' -dest:contentPath='sub2',ComputerName='https://waws-prod-sn1-047.ftp.azurewebsites.windows.net/msdeploy.axd?site=sub2',UserName='$sub2',Password='key',AuthType='Basic'
If we published project to Azure, we have no easy way to see which subscription it belongs to. I suggest you submit a voice at Azure feedback forum.

How to publish a Web Application to another persons azure subscription

I currently have a Web Application and SQL Database instance published on my own personal Azure trial subscription. However the app is now finished and I want to hand ownership over to the person I am creating it for. So I want to publish it to his Azure subscription, so he can look after billing, monitor, and have ownership of the application etc.
I asked him to add me as a user to his account, and now I see his company name listed as a 'Directory' from the portals home page (along with my Default Directory, my Web App, and my SQL Database). I don't know how to proceed from here. I want to be able to Publish it from Visual Studio 2013 - then run my code first migrations to create the database, all to a location that his company and not me is responsible for.
Is my approach to this wrong? In a general sense, how do you develop a test application (and test it in Azure) and publish it for someone else on Azure?
The first comment on the question is sort of what I am trying to achieve:
Transfer all data from my account to another in the same Azure subscription
"What do you mean by from my account to another in the same Azure subscription? Normally I have seen folks want to move data from one subscription to another one (say from Dev Subscription to Prod Subscription)."
But if I just transfer the app I wouldn't be able to make changes in VS and re-publish it, for example.
EDIT:
I found this article on Migrating an enterprise web app to an Azure service. Would it be possible to Publish the app to my local dev machine (with local database), then use the Migration Assistance to move it to Azure? Obviously to do this I would need my clients Microsoft ID and password to log into his subscription which is not ideal.
You will first want to make sure that the subscription appears in your "Subscription list" in the top right corner and is selected.
I am assuming you have connected your VS with your Azure subscription and are able to publish your app to your subscription from here, and that the new subscription is "missing" from your selection. But now you have been added to a new subscription but have not updated VS. Remove and readd Azure Subscriptions from VS. This should require you to log into Azure, and should pull updated account information.
Now when you Deploy your app, you will be able to select which Subscription you want to deploy it into.

Windows Azure Publish Website- "Unable to get subscription information. An item with the same key has already been added"

I'm following this tutorial here
http://www.windowsazure.com/en-us/develop/net/tutorials/get-started/#nextsteps
I'm at step 3. I click import, I can see I'm signed in with my MSDN ultimate account (I get $150 per month to spend on Azure). I then click New, and when the dialogue opens I cannot enter anything (all boxes are disabled), along with an error message in red:
http://gyazo.com/17eb15f07d54e2867cd5f21d377f04aa
Why is this? It is something with my MSDN account?
You can get also this problem if your MS account is registered with more than one Azure subscription. It appears Visual studio gets confused if your account is attached to more than one subscription and tries to use the wrong one for accessing the Azure API.
If it occurs you need to ignore the advice from #Dev Trails and instead do the following:
In Server Explorer, right-click Windows Azure node > Manage Subscriptions
In the Certificates tab Import a new subscription certificate (this will take you to the current link on the Azure portal to download your
certificate)
In the Subscriptions tab, on the specific subscription that fails,
select the drop-down and choose the certificate instead of the
username.
Refreshing the Azure explorer should now show your databases etc without error.
This is a bug in Visual Studio 2013. Found an answer posted here:
To workaround the issue, you can try the following:
In Server Explorer, right-click Windows Azure node > Manage Subscriptions
If you are signed-in to Azure, you will see the same subscription show up both in the Accounts tab and in the Certificates tab. Remove the one in the Certificates tab.
VS 2015: delete all MS Account from VS. Add once again.

Resources