Azure App Service FTP _ Azure app Service create/reset FTP user level credential through PowerShell


Azure app Service create/reset FTP user level credential through PowerShell




Issue:

·       How can I create FTP deployment credentials?

·       How to reset User credentials for azure app service?

·       I want to use PowerShell for this.

·       Can I get publish profile details through PowerShell?



Solution:

We all are aware that Azure app service content can be accessed through FTP.  This is one of the most easy and popular way to deploy your content to Azure app service.
When you create an app service or web app, Azure add an FTP hostname with that app. You can get the FTP hostname information in the “Overview” blade of your app service.




Here it is very important to understand that Azure app service support 2 types of credentials,
·       User Level credentials
·       App Level credentials

User level credentials are for entire Azure account which can be used to deploy to any web app for the subscription,

while App Level credentials are particular web app specific and can't be used with any other web app. App Level credentials are generate automatically at app creation. Users can’t control this manually.
Now question is, where can I check these credentials and answer is simple,
Go to “deployment center” blade and click on FTP.


Once you click on “dashboard” button, a new pop up window will appear with App and user level credentials.



You can see that App level credentials can only be reset but you don’t have control to define the username or password here.
You can control user level credentials. Here we have one catch; you can have only one FTP user level credential. You can’t have multiple FTP user level credentials.

Now, If you want to create/reset user level or app level credentials using PowerShell then answer is Yes it is possible.

Ø  Create or Reset User level credentials,

$properties = @{        publishingUserName = “<your user name>”;
 publishingPassword = “<your password>”
    }
Set-AzureRmResource -Properties $ properties -ResourceId /providers/Microsoft.Web/publishingUsers/web -ApiVersion 2015-08-01 -Force

# -ApiVersion : Specifies the version of the resource provider API to use. If you do not specify a version, this cmdlet uses the latest available version.

Ø  You can get the publish profile user details,

Invoke-AzureRmResourceAction -ResourceGroupName <resource group name> -ResourceType Microsoft.Web/sites/config -ResourceName <your site name>/publishingcredentials -Action list -ApiVersion 2015-08-01 -Force

# -ApiVersion : Specifies the version of the resource provider API to use. If you do not specify a version, this cmdlet uses the latest available version.
#You can find credentials details in the properties

I hope this helps. Please comment if you have any query

Other useful FTP links,


Other useful references,

Issue: Azure function is throwing one of the following exceptions
·       Unable to retrieve Functions Keys
·       We are not able to retrieve the keys for function
·       The function runtime is unable to start.
·       Function host is not running.
·       Internal Server error.
·       Service Unavailable.

Issue: Azure Functions: The Consumption pricing tier is not allowed in this resource group


Issue: Disable Azure functions






No comments:

Post a Comment