How to create File Share in azure resource manager template itself? - azure-resource-manager

I am trying to automate deployment process of Moodle(https://moodle.org/) using ARM template.
Now, i have used Azure CLI commands for creating File Share in Azure Storage Account, But, is there any way to specify file share within the template itself?

Related

Manage User Secrets in a custom config file

I have a Xamarin.Forms app. As it does not have built in configuration file, I used a solution found here:
https://www.andrewhoefling.com/Blog/Post/xamarin-app-configuration-control-your-app-settings
and here
https://github.com/HoeflingSoftware/XamarinAppSettings
So now I have a custom appsettings.json file. The secrets in the file are replaced in AzureDevops pipeline. But how can I run the app from Visual Studio (on an emulator)? If it was a web application, I would use Manage User Secrets functionality, which would store the secrets in my file system. So it would be used automatically when the app is running during development. But how can I do it for a Xamarin.Forms app with its custom json file?
You could use the Replace Text in Source Files task on Marketplace to replace text in your source, before you build the project. You can then store the secret as a secure value in the pipeline variables library.
We use a similar approach to update the build versions for Xamarin Apps and for providing access to the Signing files.

How to deploy Azure Web Apps using Azure Resource Manager-Based PowerShell?

I want to deploy my Azure web apps using PowerShell. Here is my expected workflow:
Create Package using MSBuild
Deploy the package to Azure
I tried with the approach described in the below link:
https://github.com/gregpakes/DoIHaveGPS/blob/master/PublishScripts/Publish-WebApplication.ps1
I modified the script to use an existing web app instead of creating. So I call something like Get-AzureWebsite -Name $Config.name..
But it never finds the existing app service (web app) due to the subscription issue. I tried so many times to switch the subscription but it's not working. Get-AzureWebsite always keep searching on the old subscription which I don't use anymore.
If I call Get-AzureRmSubscription from powershell I get two subscriptions but if I call Get-AzureSubscription I get only one.
How can I deploy my application packages using powershell using resource manager based powershell?
The cmdlets used by the script you linked to are using the "old" service management interface. If Get-AzureSubscription doesn't return a subscription that means it's only available to use via AzureRM. The AzureRM web app cmdlets don't have a simple "publish" command as the old ones did... So if you wanted to replicate that in PowerShell you could do something like this:
$deploycmd = "$env:ProgramFiles\IIS\Microsoft Web Deploy V3\msdeploy.exe"
$packageLocation = Resolve-Path -Path "C:\users\bjm\downloads\package.zip"
$webAppName = 'myazuresite'
$user = '$myazuresite'
$pass = 'jSjku1lWBdZNgGjyZWYfDhFn4DFfZlAqTq1RjPu5Fnv3yYe9l2Fl5xz5RK0x'
$setParam = "-setParam:name=""IIS Web Application Name"",value=$webAppName"
$dest = "-dest:auto,ComputerName='https://$webAppName.scm.azurewebsites.net:443/msdeploy.axd?site=$webAppName',UserName='$user',Password='$pass',AuthType=Basic"
& $deploycmd "-verb:sync", "-source:package=$packageLocation", $setParam, $dest
I actually prefer juvchan's approach but if you've already got the rest in place via PS this might be easier.
After you've created the web deploy package for your application, you need to create a Azure Resource Manager (ARM) template which allows you to deploy to a Azure web app using the web deploy package.
Then you can use the Azure PowerShell cmdlet below to deploy your ARM template above to achieve what you require.
New-AzureRmResourceGroupDeployment -Name <deployment-name> -ResourceGroupName <resource-group-name> -TemplateUri <ArmTemplateJsonUri>
Useful references:
Deploy a web app with MSDeploy, custom hostname and SSL certificate
Deploy your app to Azure App Service
https://github.com/Microsoft/azure-docs/blob/master/articles/azure-resource-manager/resource-group-template-deploy-cli.md
https://github.com/Microsoft/azure-docs/blob/master/articles/azure-resource-manager/resource-group-template-deploy-cli.md
This topic shows how to use the Azure portal with Azure Resource Manager to deploy your Azure resources. To learn about managing your resources, see Manage Azure resources through portal. Currently, not every service supports the portal or Resource Manager. For those services, you need to use the classic portal. For the status of each service, see Azure portal availability chart.
1. To create an empty resource group, select New > Management > Resource Group.
2. Give it a name and location, and, if necessary, select a subscription. You need to provide a location for the

The easiest way to access Azure File Storage?

I need to migrate an application to Azure and I have a Azure Web Application with 50gb storage space and an Azure File Storage with 250gb, that I'll use to store videos, images and other things.
My application stores the files in a folder in the same directory of my application, so It was easy to do, I didn't have to access another server, like Azure File Storage seems to be.
I have access by FTP to my app folder, like It was at the other server, but this folder only have the 50GB of storage. Does exist an way of mapping the 250gb's Azure File Storage folder to my app folder, or I'll have to change my code to use the Azure API?
Your application can work against Azure File shares without code changes. You will need to persist credentials using cmdkey, and then instead of local path, use the file share path or mounted drive within your application. For more information you can refer to:
How to use Azure Files on Windows
How to use Azure Files on Linux
I run a batch file on login which runs the following command, you can use whichever drive letter you choose:
net use <drive-letter>: /delete /y
net use <drive-letter>: \\<storage-account-name>.file.core.windows.net\<share-name> /u:<storage-account-name> <storage-account-key>
An example with dummy information would look like this:
net use t: /delete /y
net use t: \\testaccount.file.core.windows.net\testshare /u:accountname verylongstorageaccountkey

How to migrate project in PeopleSoft if connect id password is different?

To migrate a project from one environment to another in PeopleSoft using Application Designer Connect Id credentials(default is people/peop1e) must be same in both environment.
Is there any way we can migrate projects if connect id and password are different in both the environment.
You could copy the project to a file between environments:
Save the project to a file from the source environment
Change the connect information in Configuration Manager
Copy the project from a file in the destination environment
Or it looks like you could you use App Designer Command Line parameters to copy the project from one database to another with different connect passwords but I haven't tried it. Here is the PeopleBooks page for Understanding PeopleSoft Application Designer Command Line Parameters and the Command Line Parameter Reference

Create Azure Cache Programmatically

I am creating an application that automate the deployment to Azure Web Sites. I was able to create Azure Web Site, database and storage programmatically but I didn't saw any library out there that can create Azure Cache programmtically. Anyone?
Thanks in advance. :)
Whatever operations you perform on Windows Azure Management Portal is backed by Windows Azure Service Management API. I'm pretty sure that there's an API for creating and configuring caching programmatically but it has not been made public yet. I would recommend keeping an eye out on the REST API documentation page. This is where you will find information about how you could create cache programmatically.
Azure Managed Cache is in preview and hence REST API are not available for it. Also it can not be created from Portal. However, you can use Powershell commands to create it. Once created you can then manage it from azure portal itself.
Following command can be used for creating Basic Cache of 128MB.
New-AzureManagedCache -Name YourCacheName -Location "YourLocation"
For the detailed steps refer to - Create Azure Managed Cache from Powershell
So you can create .ps1 file or powersehll commands string which then can be invoked from your code.
Hope this helps.

Resources