{"id":20296696,"url":"https://github.com/0gis0/adomdapi","last_synced_at":"2025-05-07T20:33:44.555Z","repository":{"id":105241927,"uuid":"133839302","full_name":"0GiS0/adomdapi","owner":"0GiS0","description":"PoC to query Azure Analysis Services from a web API using ADOMD library","archived":true,"fork":false,"pushed_at":"2018-05-23T09:15:39.000Z","size":1503,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-04T05:42:51.860Z","etag":null,"topics":["adomd","azure","azure-analysis-services","csharp","csharp-code","microsoft-azure"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/0GiS0.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-05-17T16:15:44.000Z","updated_at":"2024-03-13T07:13:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"3016aedd-7500-4069-bcd8-b1a913bc54bf","html_url":"https://github.com/0GiS0/adomdapi","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0GiS0%2Fadomdapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0GiS0%2Fadomdapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0GiS0%2Fadomdapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0GiS0%2Fadomdapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/0GiS0","download_url":"https://codeload.github.com/0GiS0/adomdapi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252953716,"owners_count":21830890,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["adomd","azure","azure-analysis-services","csharp","csharp-code","microsoft-azure"],"created_at":"2024-11-14T15:40:25.014Z","updated_at":"2025-05-07T20:33:44.522Z","avatar_url":"https://github.com/0GiS0.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# adomdapi\nPoC to query Azure Analysis Services from a web API using ADOMD library\n\n**1. Create an Azure Analysis Services Account**\n\n![Create an Azure Analysis Services Account](./screenshots/1.a.Create-an-Azure-Analysis-Services-Account.PNG)\n\n\n**Server Name**: The name of your Analysis Server.  \n**Subscription**: The Azure subscription you want to use.  \n**Resource group**: You can choose an existing resource group or create a new one.  \n**Location**: Select the datacenter where you want to deploy your service.  \n**Pricing tier**: B1 would be enough for this demo.  \n**Administrator**: Your account is chosen by default.  \n**Backup Storage Settings**: You must select or create a storage account.  \n**Storage key expiration**: It can be Never for this demo.  \n\n**2. Create Adventure Works model**\n\nOnce you have your Analysis Service account created you need to create a model. For this PoC we chose the Adventure Works model. Click on **+ New Model**:\n\n![Create a new model](./screenshots/2-Create-a-new-model.PNG)\n\nSample data will be selected so you just need to click **Add**.\n\n**3. Create Azure Active Directory application - Native app.**\n\nIn order to get an access token that gives you access to the Analysis Service account you have to create an Azure Active Directory Application. Click on Azure Active Directory on the portal, select **App registrations** and click on **+ New application registration** in the top menu. You will need:\n\n**Name**: the name of your application.  \n**Application type**: Native\n**Redirect URI**: You can choose the URI what you want. It doesn't need to be a physical endpoint.\n\n![Create Azure Active Directory App](./screenshots/3.Create-azure-active-directory-app.PNG)\n\nThe final step is to give access to this application to Azure Analysis Services. Click on **Settings**:\n\n![Registered app - Settings](./screenshots/3b-Registered-app-Settings.PNG)\n\nSelected **Required permissions**, click on **+ Add** and search for Azure Analysis Services and select it.\n\n![Select an API - Azure Analysis Services](./screenshots/3c.Select-an-API-Azure-Analysis-Services.PNG)\n\nCheck on **Read and Write all Models** and click on **Done** to finish the configuration.\n\n**4. Configure AADAccessToken.**\n\nThis are the App Settings you have to configure in the AADAccessToken program:\n\n    \u003c!--Azure Active Directory values--\u003e\n    \u003cadd key=\"aad:RedirectUri\" value=\"[Reply URL from you Azure Active Directory Native App]\"/\u003e\n    \u003cadd key=\"aad:Authority\" value=\"https://login.windows.net/common\"/\u003e\n    \u003cadd key=\"aad:ClientId\" value=\"[Your Azure Active Directory App Id]\"/\u003e\n    \u003c!-- Azure Analysis Services --\u003e\n    \u003cadd key=\"aad:ResourceUri\" value=\"https://westeurope.asazure.windows.net\"/\u003e\n    \u003c!-- End Azure Active Directory values--\u003e\n    \u003c!-- Web API URL--\u003e\n    \u003cadd key=\"apiUrl\" value=\"http://localhost:50117/api/values/?query=\"/\u003e    \n\n**5. Configure WebAPI**\n\nThe only parameter you need to configure as App Setting is the Azure Analysis Service data source.\n\n    \u003c!-- Azure Analysis Services --\u003e    \n    \u003cadd key=\"asDataSource\" value=\"[Azure Analysis Services Data Source - ex: asazure://westeurope.asazure.windows.net/returngis]\"/\u003e\n    \u003c!-- End Azure Analysis Services --\u003e\n\n**6. Test it!**\n\nRun both projects and login with your credentials for the console. Once you have successfuly logged you can see the next message:\n\n![Connected to Azure Analysis Services](./screenshots/Console-App-Connected-To-Azure-Analysis-Services.png)\n\nIf you are using the adventure works model you can test one of these queries:\n\nEvaluate TOPN(10,Customer,Customer[Customer Id],1)\n\n![Evaluate TOPN(10,Customer,Customer[Customer Id],1)](./screenshots/Query-1.PNG)\n\nEvaluate(ROW(\"Count\",COUNTROWS('Product')))\n\n![Evaluate(ROW(\"Count\",COUNTROWS('Product')))](./screenshots/Query-2.png)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0gis0%2Fadomdapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F0gis0%2Fadomdapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0gis0%2Fadomdapi/lists"}