Visual Studio 2019 SSIS dtexec config file Azure Blob Key - visual-studio

My question is around : storing Azure blob key in config file.
Below is the picture of my package overview. I'm trying to pull data from Oracle source and put a flat file on Azure blob storage (in csv format). That is the scope of this SSIS package.
Right side of picture shares that I can execute the package via commandline if **Protection level =' EncryptSensistiveWithUserKey' **
But NOW packages need to be run via a service account and not developer, architects accounts.
Looping back into my question: HOW do I store blob key in config file by setting the **Protection level = 'DONOTSAVESENSITIVE'** . Config file code after the package overview.
Config File currently being used
<?xml version="1.0"?><DTSConfiguration><DTSConfigurationHeading><DTSConfigurationFileInfo GeneratedBy="BI\MonkeyMan" GeneratedFromPackageName="Package" GeneratedFromPackageID="{9BDF0000-CAC9-4823-A6D8-EE59C3BB31A0}" GeneratedDate="4/6/2020 6:48:57 PM"/></DTSConfigurationHeading><Configuration ConfiguredType="Property" Path="\Package.Connections[Prod v18].Properties[ConnectionString]" ValueType="String">
<ConfiguredValue>SERVER=1.1.1.01:1521/DB;USERNAME=MonkeyMan;WINAUTH=0;data source=1.1.1.01:1521/DB;user id=MonkeyMan;password=isharemypasswords;
</ConfiguredValue></Configuration></DTSConfiguration>
Finally picture of when I try to run the package via dtexec with protection level set to DO NOT SAVE SENSITIVE.
Thanks for all your help around this.

The easiest way might be to use the builtin config-editor and select the properties you want to save to the config file.
Here's one tutorial to set it up: https://www.tutorialgateway.org/ssis-package-configuration-using-xml-configuration-file/

Related

Where can I find the database Room.DataBaseBuilder(...).build() creates?

I'm quite new to android and I am currently working on a app which should utilize a Room database. Following the documentation a room database can be created through the following lines:
myDatabase = Room.databaseBuilder(appContext, MyDatabase.class, "MyDB")
.build();
Now where did room create the database file?
It can't be found in my project folder.
The documentation doesn't mention anything about it and -generally speaking- barely gives any information about how this thing works.
Where is the database?
Does DatabaseBuilder.build() manage, to open the existing database created from previous app launches?
The list of questions is long.
Any information about the .build() thing aswell as further information about Room (misconceptions etc.) are very appreciated, for the documentation doesn't really make things clear for me.
Thank you!
Now where did room create the database file?
The database (a file) will be placed at the default location on the actual device which is data/data/<the_package_name>/database/MyDB.
In your case, as you have coded :-
myDatabase = Room.databaseBuilder(appContext, MyDatabase.class, "MyDB")
.build();
Then the database files will be: -
data/data/<your_package_name>/databases/MyDB
data/data/<your_package_name>/databases/MyDB-wal
data/data/<your_package_name>/databases/MyDB-shm
It can't be found in my project folder.
The database file is not part of the project, it is a file that is created and maintained on the actual device on which the App has been installed.
However, you can use Database Inspector (now App Inspection) on Android Studio to view the database e.g. :-
You can also view the files, if whatever device you test on allows access, by using Device File Explorer. e.g.
Does DatabaseBuilder.build() manage, to open the existing database created from previous app launches?
Yes, if the file exists then it is opened otherwise the file is created. If you uninstall the App this effectively delete's the file. The whole idea of a database is that it persists.
The build() undertakes various tasks, primarily seeing if the underlying file exists and then opening the file. In doing so it
extracts the version number that is stored in the file and compares the number against the number coded within the App (via the #Database).
If the version number from the App is greater then an attempt is tried to find a Migration (recently AutoMigration's have been added to Room).
compares the expected schema (according to the entities defined as part of the #Database), against what is found in the file.
A mismatch will result in the app crashing, so fixes would have to be made.
Note references to file is a simplification, by default Room uses a loggin mode called WAL (Write-Ahead Logging). In WAL mode there will be an additional 2 files that the SQLite routines maintain (you don't need to do anything):-
the database file name suffixed with -wal is the primary wal file into which changes are written (they are applied to the main database automatically).
the database file name suffixed with -shm (this is a WAL file for the WAL file).

Azure Storage Explorer - Inadequate resource type access

I am attempting to use the Microsoft Azure Storage Explorer, attaching with a SAS URI. But I always get the error:
Inadequate resource type access. At least service-level ('s') access
is required.
Here is my SAS URI with portions obfuscated:
https://ti<...>hare.blob.core.windows.net/?sv=2018-03-28&ss=b&srt=co&sp=rwdl&se=2027-07-01T00:00:00Z&st=2019-07-01T00:00:00Z&sip=52.<...>.235&spr=https&sig=yD%2FRUD<...>U0%3D
And here is my connection string with portions obfuscated:
BlobEndpoint=https://tidi<...>are.blob.core.windows.net/;QueueEndpoint=https://tidi<...>hare.queue.core.windows.net/;FileEndpoint=https://ti<...>are.file.core.windows.net/;TableEndpoint=https://tid<...>hare.table.core.windows.net/;SharedAccessSignature=sv=2018-03-28&ss=b&srt=co&sp=rwdl&se=2027-07-01T00:00:00Z&st=2019-07-01T00:00:00Z&sip=52.<...>.235&spr=https&sig=yD%2FRU<...>YU0%3D
It seems like the problem is with the construction of my URI/endpoints/connectionstring/etc, more than with permissions granted me on the server, due to the fact that when I click Next, the error displays instantaneously. I do not believe it even tried to reach out to the server.
What am I doing wrong? (As soon as I get this working, I'll be using the URI/etc to embed in my C# app for programmatic access.)
What you need to connect is a service requirement the "SRT" part of the URI.
The URI you have has a SRT of "CO" container and object and needs the "S" part, you need to create a new sas key this can be generated in portal, azure cli or powershell.
In the portal is this part:
You have to enter to the storage acount and select what you need:
Allowed services (if you are looking for blob)
Blob
Allowed resource types
Service (make sure this one is activated)
Container
Object
Allowed permissions (this to do everything)
Read
Write
Delete
List
Add
Create
Example where to look
If you need more info look here:
https://learn.microsoft.com/en-us/rest/api/storageservices/create-account-sas?redirectedfrom=MSDN
If you like to create the SAS key in the CLI use this:
https://learn.microsoft.com/en-us/azure/storage/blobs/storage-blob-user-delegation-sas-create-cli
If you like to create the SAS key in powershell use this:
https://learn.microsoft.com/en-us/azure/storage/blobs/storage-blob-user-delegation-sas-create-powershell
I has a similar issue trying to connect to the blob container using a Shared Access Signature (SAS) URL, and this worked for me:
Instead of generating the SAS URL in Azure Portal, I used Azure Storage Explorer.
Right click the container that you want to share -> "Get Shared Access Signature"
Select the Expiry time and permissions and click create
This URL should work when your client/user will try to connect to the container.
Cheers
I had the same problem and managed to get this to work by hacking the URL and changing "srt=co" to "srt=sco". It seems to need the "s".

How to export Server Group configurations?

How can I export to file my Server Group configurations in Azure Data Studio?
I've created a Workspace file in my application solution that contains useful queries for troubleshooting, etc. I'd like to also include connection configurations for servers relevant to the solution so that any developer can use the Workspace queries quickly without having to ask which servers to run them on.
You can copy your Server Group configurations from User Settings. You will find them under datasource.connectionGroups and connection details under datasource.connections (if you have different ones, check with the group id). Any user can copy paste them into his user settings except the password. Everyone needs to add it after that. I would suggest to create a JSON file with those settings and add the steps to readme.md file.
All connections and groups are located in the settings.json file located at:
%AppData%\azuredatastudio\User\
For me specifically the path looked like this:
C:\Users\MyLogin123\AppData\Roaming\azuredatastudio\User

Where is <TeamCity Data Directory>/config/database.<database_type>.properties.dist?

I'm trying to migrate my TeamCity server to use SQL Server following the instructions at https://confluence.jetbrains.com/display/TCD10/Migrating+to+an+External+Database.
In step 3 it says
Create a temporary properties file with a custom name (for example, database.database_type.properties) for the target database using the corresponding template (TeamCity Data Directory/config/database.database_type.properties.dist).
but I can't find database.database_type.properties.dist anywhere on disk or in the installer package.
Where is database.database_type.properties.dist?
It's database.<database_type>.properties.dist where <database_type> in your case is mssql, so you should look for a file database.mssql.properties.dist.
The file is under <TeamCity data directory>/config. Path to the data directory you can see on Administration -> Global Settings page in TeamCity web interface.

Blob files have to renamed manually to include parent folder path

We are new to Windows azure and have used Windows azure storage for blob objects while developing sitefinity application but the blob files which are uploaded to this storage via publishing to azure from Visual Studio uploads files with only the file names and do not maintain the prefix folder name and slash. Hence we have to rename all files manually on the windows azure management portal and put the folder name and slash in the beginning of each file name so that the page which is accessing these images can show the images properly otherwise the images are not shown due to incorrect path.
Though in sitefinity admin panel , when we upload these images/blob files in those pages , we upload them inside a folder and we have configured to leverage sitefinity to use azure storage instead of database.
Please check the file attached to see the screenshot.
Please help me to solve this.
A few things I would like to mention first:
Windows Azure does not support rename functionality. Rename blob functionality = copy blob followed by delete blob.
Copy blob operation is asynchronous so you must wait for copy operation to finish before deleting the blob.
Blob storage does not support folder hierarchy natively. As you may have already discovered, you create an illusion of a folder by prepending a blob name (say logo.png) with the name of folder you want (say images) and separate them with slash (/) so your blob name becomes images/logo.png.
Now coming to your problem. Needless to say that manually renaming the blobs would be a cumbersome exercise. I would recommend using a storage management tool to do that. One such example would be Azure Management Studio from Cerebrata. If you use that tool, essentially what you can do is create an empty folder in the container and then move the files into that folder. That to me would be the fastest way to achieve your objective.
If you wish to write some code to do that, here are the steps you will take:
First you will list all blobs in a blob container.
Next you will loop over this list.
For each blob (let's call it source blob), you would get its name and prepend the folder name that you want and create an instance of a CloudBlockBlob object.
Next you would initiate a copy blob operation on that blob using StartCopyFromBlob on this new blob where source is your source blob.
You would need to wait for the copy operation to finish. Once the copy operation is finished, you can safely delete the source blob.
P.S. I would have written some code but unfortunately I'm stuck with something else. I might write something later on (but please don't hold your breath for that :)).

Resources