Automating SSAS 2012 Deployment? - deployment

Not using TFS. I can build via devenv and run the deployment commandline with /O to create an XMLA file, but how to deploy the XMLA? Apparently ASCMD doesn't work in SQL 2012? Most of the posts and docs I've read are from SQL 2005/2008. I've not seen anything that specifically addresses how to deploy to SSAS 2012...

According to Microsoft BI Support the correct process to deploy an XMLA file is to use PowerShell's Invoke-ASCmd cmdlet. This is Microsoft's supported replacement for the old ASCMD utility.

Related

PowerShell script to deploy model metadata from *bim files to SQL Server Analysis Services

I have a remote server that will be used as Power BI and Analytics Services on premises
Everything necessary is installed there (SQL + SSAS +PBIRS + Kerberos)
One of my challenges is to deploy model metadata from *.bim files (that are stored in GitLab) to SSAS with the help of PowerShell
I would like to write a PowerShell script that would be executed from GitLab CI pipeline (note that I can only build Linux based containers that can run PowerShell scripts) which would grab specific .bim file and deployed it to SSAS (TabularEditor might be used?!)
Any help would be much appreciated!

How to execute a DMV query in SSAS through a powershell runbook from Azure Automation?

I am trying to open a connection with a ssas server and execute a dmv query in order to extract table metadata, through a powershell runbook from an Azure Automation Account.
I have already written and tested a powershell script that seems to work fine on my local machine, but when I run the same script on the cloud as an azure runbook it seems impossible to open a connection.
I used this code to open the connection with ssas:
$connectionString = "Provider=msolap; Data Source=asazure://westeurope.asazure.windows.net/servername;User Id={0};Password={1}; Initial Catalog=DataModel" -f $ssasUser, $ssasPassword;
## Connect to the data source and open SSAS
$connection = New-Object System.Data.OleDb.OleDbConnection $connectionString
$connection.Open()
I can't seem to be able to open a connection, as I run this code I receive the following error:
System.Management.Automation.MethodInvocationException: Exception calling "Open" with "0" argument(s): "The .Net Framework Data Providers require Microsoft Data Access Components(MDAC). Please install Microsoft Data Access Components(MDAC) version 2.6 or later."
Searching on the web, the only solution I found seems to be to simply download and install the MDAC sdk but this can't be done while running on the cloud.
I need help to fix this error or find an alternative solution.
Thank you.
As the source in the connection string is having asazure so I assume that it's an Azure Analysis server so I would recommend you to import SqlServer module in your Azure Automation account as explained here and then use Invoke-ASCmd cmdlet in your runbook.
Related references:
https://www.sqlshack.com/azure-automation-automate-pause-and-resume-of-azure-analysis-services/
https://techcommunity.microsoft.com/t5/sql-server-support/automating-azure-analysis-service-processing-using-azure/ba-p/319006
https://cloudblogs.microsoft.com/industry-blog/en-gb/technetuk/2018/06/22/how-to-automate-processing-your-azure-analysis-services-models/
https://jorgklein.com/2017/02/02/process-azure-analysis-services-databases-from-azure-automation/
https://learn.microsoft.com/en-us/dotnet/api/system.data.oledb.oledbconnection?view=dotnet-plat-ext-5.0
https://www.powershellgallery.com/packages/OledbSql/1.0.4

Azure DevOps how to run exe database migration

We have fluent migrator wrapped in a .net core console app which we added extra functionally to. We had this working on octopus deploy but trying to get it to work in azure DevOps release pipeline is proving very difficult.
We have a Deploy.ps1 powershell file with a single command in it which is as follows
& .\Migrations.exe -connectionStrings "Server=<server>,1433;Initial Catalog=MigrationTest-Dev;Persist Security Info=False;User ID=<name>;<password>;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;"
This runs fine locally and as I say on our octopus box.
How would I be able to run this in devops release pipeline, I can only think its permission related maybe!?
The below is the current Powershell task in the release pipeline
If anyone could provide some help it would be greatly appreciated
I got this working after finding this post https://rajbos.github.io/blog/2019/08/17/AzureDevOps-Run-NET-Core.
The solution was this PowerShell task, which this inline script. Note that because this is a .net core console app I could run dotnet on the .dll and don't have to use the .exe
cd "$(System.DefaultWorkingDirectory)/_SqlMigrationsTest/Migrations-Wip/Migrations"
dotnet Migrations.dll -connectionStrings "Server=<server>;Initial Catalog=MigrationTest-Dev;Persist Security Info=False;User ID=<name>;Password=<password>;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;"
The yaml looked like this if I clicked the View YAML link.
steps:
- powershell: |
cd "$(System.DefaultWorkingDirectory)/_SqlMigrationsTest/Migrations-Wip/Migrations"
dotnet Migrations.dll -connectionStrings "Server=<server>;Initial Catalog=MigrationTest-Dev;Persist Security Info=False;User ID=<name>;Password=<password>;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;"
displayName: 'Run Migration'
So this did run but then I had an issue with the azure database firewall rules, I spent a day looking into powershell script to connect to the database and add a new firewall rule. The IP constantly changes in devOps(which is expected). I never got the azure firewall scripts working, it was all around Get-AzureRmSqlServerFirewallRule or the other Get-AzureSqlDatabaseServerFirewallRule which was a very painful approach that never worked.
I later stumbled upon the solution where the azure database has firewall settings(which I knew I could add manually). There is a toggle to Allow Azure services resources to access this server. Putting this to Yes made it all work, finally.

Oracle Snapins or modules availability

I need to write a powershell script which runs various commands on an oracle server.
Are there Snapins or modules available for oracle like there are for SQL server etc?
I did my research but couldn't find anything.
Have a read of this blog: https://blogs.technet.microsoft.com/heyscriptingguy/2012/12/04/use-oracle-odp-net-and-powershell-to-simplify-data-access/
It makes reference to "Oracle Managed DataAccess provider OPD.NET" - this is what I've used when I've needed to interact with Oracle databases

Update Web.config configuration with powershell on Azure Release Script

I'm running my Deployments on the Release Management(Currently Preview) tool in VSO.
When you configure a new Release(with the new release management tool on VSO) you can add to the Flow a task named:Azure PowerShell(Run a PowerShell script within an Azure environment)
What i'm trying to do is to Make some changes to the web.config using the Get-WebApplication and then Set-WebConfigurationProperty.
the error i get from the Log is:
Process should have elevated status to access IIS configuration data.
##[error]Cannot find a provider with the name 'WebAdministration'.
Is it even possible to run those kind of commands in there or do you i need to use another kind of command to update my web.config?
There is no Azure API to make arbitrary transforms to your web.config.
Instead, the way this is typically done is to use the deployment time transform engine (e.g. via Web.Debug.config or using Chained Config transforms).
If you're trying to set the web.config of an Azure WebApp then you need to use the Set-AzureWebSite cmdlet or the Set-AzureRMWebApp cmdlet.
Which one you need to use depends on which Azure cmdlets are installed on the machine running the script. The hosted servers for RM may still have the 0.9.x cmdlets (which uses SetAzureWebSite). The Set-AzureRMWebApp cmdlet is in the 1.x cmdlets. Either will work to set the config, you just need to use the appropriate cmdlet for what's have installed.