Merge pull request #2 from alfredodev/master

Replace DocumentDB with CosmosDB
This commit is contained in:
tarasha 2017-08-08 07:16:27 -07:00 коммит произвёл GitHub
Родитель 43b33fcb27 55c333c26b
Коммит f89736d9ce
12 изменённых файлов: 21 добавлений и 21 удалений

Просмотреть файл

Просмотреть файл

@ -36,7 +36,7 @@ Remove-Module MSCorp.FirstResponse.AzureSearch.Commands -ErrorAction Ignore
Remove-Module MSCorp.DocumentDb.Commands -ErrorAction Ignore
Import-Module $script_dir\ShardManagement.psm1
Import-Module $script_dir\DocumentDb\MSCorp.DocumentDb.Commands.dll
Import-Module $script_dir\CosmosDB\MSCorp.DocumentDb.Commands.dll
Import-Module $script_dir\AzureSearch\Commands\MSCorp.FirstResponse.AzureSearch.Commands.dll
Import-Module AzureRM.Profile
Import-Module AzureRM.Resources
@ -168,9 +168,9 @@ foreach ($name in $result.Outputs.Keys) {
$OUTPUTS[$name] = $result.Outputs[$name].Value
}
# Write-Host "DocumentDb Data";
# Write-Host $OUTPUTS['DocumentDbUri'];
# Write-Host $OUTPUTS['DocumentDbAuthKey'];
# Write-Host "CosmosDB Data";
# Write-Host $OUTPUTS['CosmosDBUri'];
# Write-Host $OUTPUTS['CosmosDBAuthKey'];
#----------------#
@ -182,13 +182,13 @@ foreach ($name in $result.Outputs.Keys) {
}
#--------------------------#
# Seed documentDb database #
# Seed CosmosDB database #
#--------------------------#
Write-Host ...............................
Write-Host 'Seeding document DB data'
Write-Host ...............................
Write-Host
Add-DocumentDbSeedData -Url $OUTPUTS['DocumentDbUri'] -Key $OUTPUTS['DocumentDbAuthKey'] -DataPath $script_dir\DocumentDb\TicketData.json
Add-DocumentDbSeedData -Url $OUTPUTS['CosmosDBUri'] -Key $OUTPUTS['CosmosDBAuthKey'] -DataPath $script_dir\CosmosDB\TicketData.json
#-------------------------------#
# Trasform database credentials #
@ -336,8 +336,8 @@ if ($WebConfigPath -ne '') {
$webconfigContent = $webconfigContent.replace('[searchIndexName]', $OUTPUTS['searchIndexName']);
$webconfigContent = $webconfigContent.replace('[searchServiceName]', $OUTPUTS['SearchServiceName']);
$webconfigContent = $webconfigContent.replace('[searchServiceApiKey]', $OUTPUTS['searchApiKey']);
$webconfigContent = $webconfigContent.replace('[DocumentDbUri]', $OUTPUTS['DocumentDbUri']);
$webconfigContent = $webconfigContent.replace('[DocumentDbAuthKey]', $OUTPUTS['DocumentDbAuthKey']);
$webconfigContent = $webconfigContent.replace('[CosmosDBUri]', $OUTPUTS['CosmosDBUri']);
$webconfigContent = $webconfigContent.replace('[CosmosDBAuthKey]', $OUTPUTS['CosmosDBAuthKey']);
Set-Content -Path $WebConfigPath -Value $webconfigContent;
}
catch {

Просмотреть файл

@ -23,7 +23,7 @@
"sql_reporting_database": "[concat(parameters('prefix_name'), '-reporting')]",
"azure_search_name": "[concat(parameters('prefix_name'), 's')]",
"azure_search_index_name": "people",
"document_db_name": "[concat(parameters('prefix_name'), '-docdb')]",
"cosmos_db_name": "[concat(parameters('prefix_name'), '-docdb')]",
"location": "[resourceGroup().location]"
},
"resources": [
@ -173,11 +173,11 @@
{
"comments": "### Create Document Db ###",
"apiVersion": "2015-04-08",
"type": "Microsoft.DocumentDB/databaseAccounts",
"name": "[variables('document_db_name')]",
"type": "Microsoft.DocumentDb/databaseAccounts",
"name": "[variables('cosmos_db_name')]",
"location": "[variables('location')]",
"properties": {
"name": "[variables('document_db_name')]",
"name": "[variables('cosmos_db_name')]",
"databaseAccountOfferType": "Standard"
}
}
@ -223,13 +223,13 @@
"type": "string",
"value": "[variables('azure_search_name')]"
},
"DocumentDbUri": {
"CosmosDBUri": {
"type": "string",
"value": "[reference(variables('document_db_name')).documentEndpoint]"
"value": "[reference(variables('cosmos_db_name')).documentEndpoint]"
},
"DocumentDbAuthKey": {
"CosmosDBAuthKey": {
"type": "string",
"value": "[listkeys(variables('document_db_name'), '2015-04-08').primaryMasterKey]"
"value": "[listkeys(variables('cosmos_db_name'), '2015-04-08').primaryMasterKey]"
},
"SearchIndexName":{
"type": "string",

Просмотреть файл

@ -1,7 +1,7 @@
# FIRST RESPONSE ONLINE
First Response Online is a communication and collaboration platform built to support first responders. It lets police officers, fire fighters, and paramedics share critical data with each other in near real-time. It supports Android, iPad, and PC and integrates with computer aided dispatch and GPS tracking. Units in the field can update their status, complete traffic stops, and even query state & federal databases all without using the radio.
First Response Online is powered by Azure. In order to build a business that handles major life-threating incidents, they not only rely on Azures proven scalability and availability but also its breadth of features to get to market quickly. By using services like App Service, Azure SQL, DocumentDB & Azure Search, First Response Online can instead focus on empowering first responders instead of maintaining infrastructure.
First Response Online is powered by Azure. In order to build a business that handles major life-threating incidents, they not only rely on Azures proven scalability and availability but also its breadth of features to get to market quickly. By using services like App Service, Azure SQL, CosmosDB & Azure Search, First Response Online can instead focus on empowering first responders instead of maintaining infrastructure.
Follow the [deployment instructions](Deploy/Deploy.md) to get you started.

Просмотреть файл

@ -14,8 +14,8 @@ namespace MSCorp.FirstResponse.WebApiDemo.Services
{
public class TicketService
{
private readonly string EndpointUri = ConfigurationManager.AppSettings["DocumentDbUri"];
private readonly string PrimaryKey = ConfigurationManager.AppSettings["DocumentDbAuthKey"];
private readonly string EndpointUri = ConfigurationManager.AppSettings["CosmosDBUri"];
private readonly string PrimaryKey = ConfigurationManager.AppSettings["CosmosDBAuthKey"];
private DocumentClient _client;

Просмотреть файл

@ -34,8 +34,8 @@
<add key="Password" value="[sqlPassword]" />
<add key="ShardMapDatabase" value="[sqlMasterDatabase]" />
<add key="ShardMapName" value="[shardMapName]" />
<add key="DocumentDbUri" value="[DocumentDbUri]" />
<add key="DocumentDbAuthKey" value="[DocumentDbAuthKey]" />
<add key="CosmosDBUri" value="[CosmosDBUri]" />
<add key="CosmosDBAuthKey" value="[CosmosDBAuthKey]" />
<add key="powerbi:ApiUrl" value="https://api.powerbi.com" />
<add key="powerbi:AccessKey" value="[AccessKey]" />
<add key="powerbi:WorkspaceCollection" value="[WorkspaceCollection]" />